#include "base/message_loop.h"

namespace sangame {
namespace base {

bool MessageLoop::FilterMessage( int message_type, void* message_ptr )
{
    switch(message_type) {
    case MSG_CREATE:
        return OnCreate((Handle*)message_ptr);
    case MSG_SETRECT:
        return OnSetRect((Rect*)message_ptr);
    case MSG_DRAW:
        return OnDraw((CanvasMessage*)message_ptr);
    case MSG_LBUTTONDOWN:
        return OnLButtonDown((MouseMessage*)message_ptr);
    case MSG_LBUTTONUP:
        return OnLButtonUp((MouseMessage*)message_ptr);
    case MSG_LBUTTONDBLCLK:
        return OnLButtonDblClk((MouseMessage*)message_ptr);
    case MSG_RBUTTONDOWN:
        return OnRButtonDown((MouseMessage*)message_ptr);
    case MSG_RBUTTONUP:
        return OnRButtonUp((MouseMessage*)message_ptr);
    case MSG_RBUTTONDBLCLK:
        return OnRButtonDblClk((MouseMessage*)message_ptr);
    case MSG_MOUSEMOVE:
        return OnMouseMove((MouseMessage*)message_ptr);
    case MSG_MOUSEWHEEL:
        return OnMouseWheel((MouseMessage*)message_ptr);
    case MSG_KEYDOWN:
        return OnKeyDown((KeyMessage*)message_ptr);
    case MSG_KEYUP:
        return OnKeyUp((KeyMessage*)message_ptr);
    case MSG_CHAR:
        return OnChar((KeyMessage*)message_ptr);
    case MSG_ACTIVATE:
        return OnActivate((bool*)message_ptr);
    }

	return OnMessage(message_type, message_ptr);
}

bool MessageLoop::OnCreate( Handle* message_ptr )
{
    return false;
}

bool MessageLoop::OnSetRect( Rect* message_ptr )
{
    return false;
}

bool MessageLoop::OnDraw( CanvasMessage* message_ptr )
{
    return false;
}

bool MessageLoop::OnLButtonDown( MouseMessage* message_ptr )
{
    return false;
}

bool MessageLoop::OnLButtonUp( MouseMessage* message_ptr )
{
    return false;
}

bool MessageLoop::OnLButtonDblClk( MouseMessage* message_ptr )
{
    return false;
}

bool MessageLoop::OnRButtonDown( MouseMessage* message_ptr )
{
    return false;
}

bool MessageLoop::OnRButtonUp( MouseMessage* message_ptr )
{
	return false;
}

bool MessageLoop::OnRButtonDblClk( MouseMessage* message_ptr )
{
    return false;
}

bool MessageLoop::OnMouseMove( MouseMessage* message_ptr )
{
    return false;
}

bool MessageLoop::OnMouseWheel( MouseMessage* message_ptr )
{
    return false;
}

bool MessageLoop::OnKeyDown( KeyMessage* message_ptr )
{
    return false;
}

bool MessageLoop::OnKeyUp( KeyMessage* message_ptr )
{
    return false;
}

bool MessageLoop::OnChar( KeyMessage* message_ptr )
{
    return false;
}

bool MessageLoop::OnActivate( bool* message_ptr )
{
    return false;
}

bool MessageLoop::OnMessage( int message_type, void* message_ptr )
{
	return false;
}

}
}